#pragma once
#include <Windows.h>
#include <map>
#include <vector>
#include <string>
#include "utility/defs.h"
#include "utility/Gets.h"
#include "md5/md5View.h"

using namespace std;

/*
================
	Md5Model
================
*/

struct Md5Model
{
	Md5Model();
	~Md5Model();
	Md5Mesh* md5mesh;
	map< string, Md5Anim* > mapAnim;
public:
	Md5Anim* GetAnim( string animname );
	string GetShader( int iMesh );
	void PushAnim( Md5Anim* pAnim, string animname );
};

/*
================
	cModelMgr
================
*/

class cModelMgr
{
public:
	cModelMgr();
	void OnInit();
	void PushModel( string filename, string modelKey );
	Md5Model* GetModel( string modelkey );
	string GetMeshShader( string shader );
	void Release();
private:
	 Md5Model* ReadFiles( string modelfiles );
private:
	cMd5Viewer* m_pMd5Viewer;

	map< string, Md5Model* > mapModels;
	Mtr* m_pMtr;
};